class Seiso::ImportMaster
  # Maps a SDM service instance to a Seiso service instance.
  #
  # Author:: Willie Wheeler
  # Copyright:: Copyright (c) 2014-2016 Expedia, Inc.
  # License:: Apache 2.0
  class Mappers::ServiceInstanceMapper

    def initialize(resolver)
      @resolver = resolver
    end

    def map(si, context)
      {
        'key' => si['key'],
        'description' => si['description'],
        'service' => @resolver.item_uri('services', si['service']),
        'environment' => @resolver.item_uri('environments', si['environment']),
        'dataCenter' => @resolver.item_uri('dataCenters', si['dataCenter']),
        'loadBalancer' => @resolver.item_uri('loadBalancers', si['loadBalancer']),
        'loadBalanced' => si['loadBalanced'],
        'minCapacityDeploy' => si['minCapacityDeploy'],
        'minCapacityOps' => si['minCapacityOps'],
        # TODO Deprecated
        'eosManaged' => si['eosManaged']
      }
    end
  end
end
